fs = require("fs")
java = require("java")
path = require 'path'

baseDir = path.resolve(process.env.PWD, "./class")

dependencies = fs.readdirSync(baseDir)
 
dependencies.forEach (dependency)->
  java.classpath.push(baseDir + "/" + dependency)

java.classpath.push(baseDir)
java.classpath.push(path.join baseDir, "tomcat-util.jar");
 
getJavaInstance = () -> return java

module.exports = 
  getJavaInstance : getJavaInstance